<!DOCTYPE composition PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
	xmlns:s="http://jboss.com/products/seam/taglib"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:rich="http://richfaces.org/rich" template="layout/template.xhtml">

	<ui:define name="body">

		<h:form id="tmpUsersForm">

			<rich:panel>
				<f:facet name="header">newUser</f:facet>

				<s:decorate id="loginField" template="layout/edit.xhtml">
					<ui:define name="label">Login</ui:define>
					<h:inputText id="login" required="true"
						value="#{tmpUserHome.instance.login}"
						disabled="#{!tmpUserHome.enabled}" validator="#{tmpUserHome.validateLogin}"/>
				</s:decorate>
				<s:decorate id="emailField" template="layout/edit.xhtml">
					<ui:define name="label">E-mail</ui:define>
					<h:inputText id="email" required="true"
						value="#{tmpUserHome.instance.email}"
						disabled="#{!tmpUserHome.enabled}" validator="#{tmpUserHome.validateEmail}"/>
				</s:decorate>
				<s:decorate id="passworField" template="layout/edit.xhtml"
					rendered="#{tmpUserHome.enabled}">
					<ui:define name="label">Password</ui:define>
					<h:inputText id="password" required="true"
						value="#{passwordBean.password}" />
				</s:decorate>
				<s:decorate id="confirmField" template="layout/edit.xhtml"
					rendered="#{tmpUserHome.enabled}">
					<ui:define name="label">Confirm password</ui:define>
					<h:inputText id="confirm" required="true"
						value="#{passwordBean.confirm}" />
				</s:decorate>

					<s:decorate id="captcha" template="layout/edit.xhtml">
						<ui:define name="label">
							<h:graphicImage value="/seam/resource/captcha" />
						</ui:define>
						<h:inputText id="verifyCaptcha" value="#{captcha.response}" />
					</s:decorate>
			



				<div style="clear: both" />

			</rich:panel>

			<div class="actionButtons">
			<h:commandButton id="save" value="Save" action="#{tmpUserHome.switchEnabled}"
				rendered="#{tmpUserHome.enabled}" /> 
		    <h:commandButton
				id="edit" value="Edit" action="#{tmpUserHome.switchEnabled}"
				immediate="true" rendered="#{!tmpUserHome.enabled}" />
		    <s:button
				propagation="end" action="#{tmpUserHome.persist}" id="confirm"
				value="Confirm" view="/home.xhtml"
				rendered="#{!tmpUserHome.enabled}" />
		    <s:button propagation="end"
				action="#{tmpUserHome.remove}" id="cancel" value="Cancel"
				view="/home.xhtml" /></div>

		</h:form>

	</ui:define>

</ui:composition>
